﻿using System;

using TrueCode.Core.Aspects;

namespace EMan.Interface.EnterpriseStructure.Jobs
{
  public partial class JobEditable
  {
    private readonly Predicate< string > _titleUniquenessPredicate;

    public JobEditable( string title, string description, [NotNull] Predicate< string > titleUniquenessPredicate) : this(title, description)
    {
      if( titleUniquenessPredicate == null ) throw new ArgumentNullException( "titleUniquenessPredicate" );
      _titleUniquenessPredicate = titleUniquenessPredicate;
    }

    public JobEditable( JobEditable source, [NotNull] Predicate< string > titleUniquenessPredicate ) : this(source)
    {
      if( titleUniquenessPredicate == null ) throw new ArgumentNullException( "titleUniquenessPredicate" );
      _titleUniquenessPredicate = titleUniquenessPredicate;
    }

    public Predicate< string > TitleUniquenessPredicate
    {
      get { return _titleUniquenessPredicate; }
    }
  }
}